#ifndef FND_GAME_CAMERA_HPP
#define FND_GAME_CAMERA_HPP
#include <sfml/system.hpp>
#include <sfml/graphics/rect.hpp>

namespace FndGame2D {
    class actor ;
    class camera {
    public:
        typedef sf::Vector2<int> position_type ;
        typedef sf::Rect<int> rect_type ;
    private:
        position_type m_position ;
        rect_type m_rect ;
        position_type m_distance ;

    public:
// camera position actions
        const position_type& position()const {return m_position ;}
        void set_position(const position_type& position) { m_position = position ;}
        const position_type& distance() const { return m_distance ;}
        void set_distance(const position_type& distance) { m_distance = distance ;}
        const rect_type& screen_size() const {return m_rect ;}
        void set_screen_size(const rect_type& rect) { m_rect = rect ;}
        bool actor_in_screen(const actor& a, rect_type* intersect_rect = 0) const ;
        bool point_in_screen(const position_type& point) const ;
        bool rect_in_screen(const rect_type& rect, rect_type* intersect_rect = 0) const ;
// init functions
        explicit camera(const position_type& position = position_type(),
                        const rect_type& rect = rect_type(),
                        const position_type distance = position_type() ) :
            m_position(position),
            m_rect(rect),
            m_distance(distance) {
        }
    } ;   

}
#endif
